

<?php

/**
 * \class activity_handler
 * \brief handles business user activities, such as events
 * \author  Sicelo Cele
 * \author  Salman Noor
 */
class activity_handler {

    /**
     * \brief object to be able use the html_builder class functionality
     */
    private $html_buillder;

    /**
     * \brief constructor of the class that initialises private data members
     */
    public function __construct() {
        $this->html_buillder = new html_elements_builder();
    }

    /**
     * \brief function that build the general information tab content using the database info
     */
    private function buildGeneralInformationContent() {
        $GIContent = "This ithe theth fente gernela infroatnation tabtertert etrer  ocntent";
        return $GIContent;
    }

    /**
     * \brief function to return the weather conditions of the particular location
     */
    private function getWeather() {
        $GIContent = "Weather Report.....";
        return $GIContent;
    }

    /**
     * \brief function to get a map for the location
     * \return html content
     */
    private function getDirectionMap() {

        $GIContent = "<div id='directionsToEventContainer' class='ui-widget-content ui-corner-all'style='border:1px solid #CCCCCC;padding:20px 20px 20px 20px;'> ";
        $GIContent .= "<div id='directionsMapContainer' class='ui-widget-content ui-corner-all'style='border:1px solid #CCCCCC;padding:20px 20px 20px 20px;'> ";
        $GIContent .= "<h2>Map Travel Guide</h2>";
        $GIContent .= "<div id='directions_map_canvas' style='width:100%; height:600px'></div>";
        $GIContent .="</div>";
        $GIContent .= "<div id='pathDirectionsContainer' class='ui-widget-content ui-corner-all'style='border:1px solid #CCCCCC;padding:20px 20px 20px 20px;'> ";
        $GIContent .= "<h2>Travel Directions Guide</h2>";
        $GIContent .= "<div id='path_directions_guide'></div>";
        $GIContent .="</div>";
        $GIContent .="</div>";
        return $GIContent;
    }

    /**
     * \brief function to get directions to the event location
     * \return html content
     */
    private function getDirections() {
        $GIContent = "Driving Directions.....";
        return $GIContent;
    }

    /**
     * \brief builds itenarary list using selector
     * \return html content
     */
    private function buildList() {

        $GIContent = " <style>";
        $GIContent .= "#feedback { font-size: 1.4em; }";
        $GIContent .= "#selectables .ui-selecting { background: #FECA40; }";
        $GIContent .= "#selectables .ui-selected { background: #F39814; color: white; }";
        $GIContent .= "#selectables { list-style-type: none; margin: 0; padding: 0; width: 100%; }";
        $GIContent .= "#selectables li { margin: 3px; padding: 0.4em; font-size: 1.4em; height: 50px; }";
        $GIContent .= "</style>";
        $GIContent .= "<h3> List of Activities to Join </h3>";
        $GIContent .= "<div id = 'select-result'></div>";
        $GIContent .= $this->html_buillder->buildButton("JoinEvent", "Join", "");
        $GIContent .= "<ol id='selectables'>";
        $GIContent .= "<li class='ui-widget-content'>Item 1</li>";
        $GIContent .= "<li class='ui-widget-content'>Item 2</li>";
        $GIContent .= "<li class='ui-widget-content'>Item 3</li>";
        $GIContent .= "<li class='ui-widget-content'>Item 4</li>";
        $GIContent .= "<li class='ui-widget-content'>Item 5</li>";
        $GIContent .= "<li class='ui-widget-content'>Item 6</li>";
        $GIContent .= "<li class='ui-widget-content'>Item 7</li>";
        $GIContent .= "</ol>";
        return $GIContent;
    }

    /**
     * \brief builds itenarary list content pulling information fromt the database
     * \return html content
     */
    private function getActivities() {

        $list = $this->buildList();
        //$this->html_buillder->buildButton("Join Event","Join Event","demo")."</div><br>";
        return $list;
    }

    /**
     * \brief builds the tabs inside the modal window
     * \return html content
     */
    private function buildActualActivityContent() {

        $siteWindow = "<div class='eventTabContainer'>";
        $siteWindow .= "<div id='eventTabs'>";
        $siteWindow .= "<ul>";
        $siteWindow .="<li><a href='#tabs-1'>General Information</a></li>";
        $siteWindow .="<li><a href='#tabs-2'>Weather</a></li>";
        $siteWindow .="<li><a href='#tabs-3'>Map & Directions Guide</a></li>";
        $siteWindow .="<li><a href='#tabs-5'>Join Activities</a></li>";
        $siteWindow .="</ul>";
        $siteWindow .="<div id='tabs-1'>";
        $siteWindow .= "<div id ='detailedEventInfo'></div>";
        $siteWindow .="</div>";
        $siteWindow .="<div id='tabs-2'>";
        $siteWindow .= $this->getWeather();
        $siteWindow .="</div>";
        $siteWindow .="<div id='tabs-3'>";

        // $siteWindow .=	$this->getDirectionMap();
        $siteWindow .="</div>";
        $siteWindow .="<div id='tabs-5'>";
        $siteWindow .= $this->getActivities();
        $siteWindow .="</div>";
        $siteWindow .="</div>";
        $siteWindow .= $this->getDirectionMap();
        $siteWindow .="</div>";
        return $siteWindow;
    }

    /**
     * \brief styles the modal window with tabs
     * \return html content
     */
    private function buildActivityLister() {
        $registrationWindow = "<div style ='font-size: 100%;' id='dialog-activity-lister' title='Safari Game Reserve'>";
        $registrationWindow .="<div style =' border: 1px solid transparent; padding: 7px' class='errorMessageDiv'> </div>";
        $registrationWindow .="<div class='responseDiv'> </div>";
        $registrationWindow .= $this->buildActualActivityContent();
        // $registrationWindow  .= $this->getTabs().tabs();
        $registrationWindow .= "</div>";
        return $registrationWindow;
    }

    /**
     * \brief displays the actual content on the modal window
     * \return html content
     */
    public function showActivityLister() {
        return $this->buildActivityLister();
    }

}
?>
